package beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;
import java.util.Collection;

public class TypePoste implements Serializable {

	private static final long serialVersionUID = -2614303711726417446L;

	private int numPoste;
	private String type;
	private int nbHeures;
	private Collection<Enseignant> listeEnseignants;
	
	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public TypePoste() {}
	
	public TypePoste(int numPoste, String type, int nbHeures) {
		super();
		this.numPoste = numPoste;
		this.type = type;
		this.nbHeures = nbHeures;
		this.listeEnseignants = null;
	}

	public Collection<Enseignant> getListeEnseignants() {
		return listeEnseignants;
	}

	public void setListeEnseignants(Collection<Enseignant> listeEnseignants) {
		this.listeEnseignants = listeEnseignants;
	}

	public int getNumPoste() {
		return numPoste;
	}
	
	public void setNumPoste(int numPoste) {
		this.numPoste = numPoste;
	}
	
	public String getType() {
		return type;
	}
	
	public void setType(String type) {
		this.type = type;
	}
	
	public int getNbHeures() {
		return nbHeures;
	}
	
	public void setNbHeures(int nbHeures) {
		this.nbHeures = nbHeures;
	}
	
	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	} 
}
